EthIR: A Framework for High-Level Analysis of Ethereum Bytecode

Analyzing Ethereum bytecode, rather than the source code from which it was generated, is a necessity when: (1) the source code is not available (e.g., the blockchain only stores the bytecode, (2) the information to be gathered in the analysis is only visible at the level of bytecode (e.g., gas consumption is specified at the level of EVM in- structions), (3) the analysis results may be affected by optimizations performed by the compiler (thus the analysis should be done ideally af- ter compilation). This paper presents EthIR, a framework for analyzing Ethereum bytecode, which relies on (an extension of) Oyente, a tool that generates CFGs; EthIR produces from the CFGs, a rule-based rep- resentation (RBR) of the bytecode. Our RBR enables the application of (existing) high-level analyses to infer properties of EVM code.